package com.lyeducation.entities.middle;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

public class SysRoleMenuEntityPK implements Serializable {
  private String roleId;
  private String menuId;

  @Column(name = "roleId", nullable = false, length = 18)
  @Id
  public String getRoleId() {
    return roleId;
  }

  public void setRoleId(String roleId) {
    this.roleId = roleId;
  }

  @Column(name = "menuId", nullable = false, length = 18)
  @Id
  public String getMenuId() {
    return menuId;
  }

  public void setMenuId(String menuId) {
    this.menuId = menuId;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    SysRoleMenuEntityPK that = (SysRoleMenuEntityPK) o;
    return Objects.equals(roleId, that.roleId) && Objects.equals(menuId, that.menuId);
  }

  @Override
  public int hashCode() {

    return Objects.hash(roleId, menuId);
  }
}
